import request from '@/config/axios'

export interface ProductionDispatchVO {
  trackingNumber: string
  sendNumber: string
  prepareId: number
  prepareNumber: string
  orderNumber: string
  dictDeliveryType: number
  customerName: string
  productNumber: string
  productName: string
  productStandard: string
  productSize: string
  trainNumber: string
  proportionExpenses: string
  customerAddress: string
  packingAddress: string
  requirements: string
  loadingStartTime: Date
  loadingEndTime: Date
  licencePlate: string
  vehicleModel: string
  driverName: string
  driverPhone: string
  creatorName: string
  updaterName: string
}

// 查询生产管理--产品管理—派车单列表
export const getProductionDispatchPage = async (params) => {
  return await request.get({ url: `/produce/production-dispatch/page`, params })
}

// 查询生产管理--产品管理—派车单详情
export const getProductionDispatch = async (id: number) => {
  return await request.get({ url: `/produce/production-dispatch/get?id=` + id })
}

// 新增生产管理--产品管理—派车单
export const createProductionDispatch = async (data: ProductionDispatchVO) => {
  return await request.post({ url: `/produce/production-dispatch/create`, data })
}

// 修改生产管理--产品管理—派车单
export const updateProductionDispatch = async (data: ProductionDispatchVO) => {
  return await request.put({ url: `/produce/production-dispatch/update`, data })
}

// 删除生产管理--产品管理—派车单
export const deleteProductionDispatch = async (id: number) => {
  return await request.delete({ url: `/produce/production-dispatch/delete?id=` + id })
}

// 导出生产管理--产品管理—派车单 Excel
export const exportProductionDispatch = async (data) => {
  return await request.download({ url: `/produce/production-dispatch/export-excel`, data })
}
